package org.sundatagroup.aurora.monitor.entity.model;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.List;

/**
 * <p>数据库使用的播放列表
 * </p>
 * @author CharlesChen
 * @date 2018-05-02
 * @since 0.1.1
 */
@Document(collection = "playlist")
public class PlayListModel implements Serializable {
    private static final long serialVersionUID = 628220578076402323L;
    @Id
    private int lid;
    private String name;
    private String desc;
    private List<Integer> projects;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public int getLid() {
        return lid;
    }

    public void setLid(int lid) {
        this.lid = lid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public List<Integer> getProjects() {
        return projects;
    }

    public void setProjects(List<Integer> projects) {
        this.projects = projects;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PlayListModel that = (PlayListModel) o;

        if (lid != that.lid) return false;
        if (!name.equals(that.name)) return false;
        if (desc != null ? !desc.equals(that.desc) : that.desc != null) return false;
        return projects != null ? projects.equals(that.projects) : that.projects == null;
    }

    @Override
    public int hashCode() {
        int result = lid;
        result = 31 * result + name.hashCode();
        result = 31 * result + (desc != null ? desc.hashCode() : 0);
        result = 31 * result + (projects != null ? projects.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "PlayListModel{" +
                "lid=" + lid +
                ", name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                ", projects=" + projects +
                '}';
    }
}
